package svgedit.gui.actions;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import svgedit.gui.Frame;

/**
 * Deletes all selected elements.
 */
@SuppressWarnings("serial")
public class UndoAction extends AbstractAction
{
    
    private Frame frame;
    
    /** Create this action for the given frame */
    public UndoAction(Frame frame)
    {
        super("Undo");
        this.frame = frame;
    }
    
    public void actionPerformed(ActionEvent ae)
    {
        frame.getUndoRedoStack().undo();
        frame.setUndoRedoVisible();
        frame.getView().clearSelection();
        frame.repaint();
        
    }
    
}
